<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <!-- <p>
            账号：<input v-model="userName" type="text">
        </p>
        <p>
            密码：<input v-model="passWord" type="text">
        </p> -->

        <!-- <p>
            篮球<input v-model="flag1" type="checkbox">
        </p>
        <p>
            听歌<input v-model="flag2" type="checkbox">
        </p>
        <p>
            跳舞<input v-model="flag3" type="checkbox">
        </p> -->

        <!-- <h3 v-for="item in arr">
            {{ item.title }}
            <input v-model="item.flag" type="checkbox">
        </h3> -->

        <!-- 需要添加value -->
        <!-- 男:<input v-model="flag" value="0" name="sex" type="radio">
        女:<input v-model="flag" value="1"  name="sex" type="radio"> -->
        <!-- 
        <select v-model="val" name="" id="">
            <option value="1">语文</option>
            <option value="2">数学</option>
            <option value="3">英语</option>
        </select> -->

        <p>
            <button @click="login">获取</button>
        </p>
    </div>

    <script src="./js/vue.js"></script>
    <script>
        // v-model
        const app = new Vue({
            el: "#app",
            data: {
                val: "",
                flag: "",
                userName: "",
                passWord: "",
                arr: [
                    {
                        title: "篮球",
                        flag: false
                    },
                    {
                        title: "听歌",
                        flag: false
                    },
                    {
                        title: "跳舞",
                        flag: false
                    }
                ]
            },
            methods: {
                change(ev) {
                    // console.log(ev.target.checked)
                },
                login() {
                    console.log(this.val)
                }
            }
        })

    </script>
</body>

</html>